package com.tankgame;

public class Tank {
    private int x;
    private int y;
    private int direct = 0;//
    private int speed;

    public Tank(int x, int y) {
        this.x = x;
        this.y = y;
        speed = 6;
    }

    public int getSpeed() {
        return speed;
    }

    public void setSpeed(int speed) {
        this.speed = speed;
    }

    public void moveUp() {
        y = y > 0 ? y -= speed : 0;
    }

    public void moveDown() {
        y = y < 830 ? y += speed : 830;
    }

    public void moveRight() {
        x = x < 960 ? x += speed : 960;
    }

    public void moveLeft() {
        x = x > 0 ? x -= speed : 0;
    }

    public int getDirect() {
        return direct;
    }

    public void setDirect(int direct) {
        this.direct = direct;
    }


    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }
}
